﻿#include "comm/LinkInterface.h"
#include "global/LinkManager.h"

LinkInterface::LinkInterface(QObject *parent,link_type_t type)
    : QObject{parent}
    , _type(type)
{

}
//---------------------------------------------------
QString LinkInterface::typeToString(link_type_t type)
{
    QString typeString{};
    switch (type) {
    case Serial:
        typeString =  QStringLiteral("Serial");
        break;
    case Tcp:
        typeString =  QStringLiteral("Tcp");
        break;
    case Modbus:
        typeString = QStringLiteral("Modbus");
        break;
    case UnKnow:
        typeString =  QStringLiteral("UnKnow");
        break;
    default:
        typeString =  QStringLiteral("UnKnow");
        break;
    }
    return typeString;
}
//---------------------------------------------------


